<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Account Management</title>
<meta content="no-cache" http-equiv="Pragma">
<meta http-equiv="X-UA-Compatible" content="IE=7"><meta http-equiv="Cache-Control"   content="no-cache">   <meta http-equiv="Expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<base target="_self" />
<link rel="stylesheet" type="text/css" href="../web/pagestyle.css"/>
<link rel="stylesheet" type="text/css" href="../web/tab.css"/>
<script>
document.write("<script src='/cgi-bin/acc.cgi?n=" + Math.random() + "'></" + "script>");
</script>
<script src="../web/DataGrid_en.js"></script>
<script src="../web/Cookies.js"></script>
<script>
function on_load(){    
    var userType=new Array("Guest","User","Administrator"); 
    for(var i=0;i<acc.length;i++){
         var _table=document.getElementById("acclist");
         document.getElementById("record").innerHTML=acc.length;
         var j=i+1;      
         _table.rows[j].cells[0].innerHTML=i;
         _table.rows[j].cells[1].innerHTML=acc[i];         
         _table.rows[j].cells[2].innerHTML=userType[level[i]];          
         _table.rows[j].cells[3].innerHTML="<a href='#'>Modify<a>";      
         _table.rows[j].cells[3].onclick=function(){EditAcc(this);};
         _table.rows[j].cells[4].innerHTML="<a href='#'>Delete</a>";
         _table.rows[j].cells[4].onclick=function(){DelAcc(this);};
         if(i==9)return false;
    } 
}
function EditAcc(obj){
    if(obj.tagName=="TD"){
        var o=obj.parentNode;
        document.getElementById("index").value=o.rowIndex-1;
        OpenDlg("../opt/accset.htm","dialogWidth=300px;dialogHeight=180px;");
        Refresh();
    }
}
function AddAcc(){
    document.getElementById("index").value="";
    OpenDlg("../opt/accset.htm","dialogWidth=300px;dialogHeight=180px;");
    Refresh(); 
}
function DelAcc(obj){
    if(obj.tagName=="TD"){
        if(confirm("Confirm to delete this account?")==true){  
            if(obj.parentNode.cells[1].innerHTML==getCookie("User")){
                alert("Deleting logined accounts not allowed");
            }else{
                obj.childNodes[0].href="/DelAcc?"+obj.parentNode.cells[1].innerHTML;    
            }            
        }
    }
    return false; 
}
function Refresh(){
    reload.click();
}
</script>
</head>
<body onload="on_load()">
<form name="form1" method="post">
  <a id="reload" href="acc.htm"></a>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="tab_03" height="30" align="right"/>
      <td class="tab_05"><table width="100%">
          <tr>
            <td width="50%" align="left"><div class="tb" />
              <span class="STYLE3">Account Management</span></td>
            <td align="right" onclick="AddAcc()" style="cursor:pointer; text-decoration:underline;"><div class="addNew"/>
              <span>Add Account</span></td>
          </tr>
        </table></td>
      <td class="tab_07"/>
    </tr>
    <tr>
      <td class="tab_12">&nbsp;</td>
      <td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6" onmouseover="changeto()"  onmouseout="changeback()"  id="acclist">
          <tr>
            <td class="STYLE6" style="width:16%">Seq</td>
            <td class="STYLE6" style="width:22%">Account</td>
            <td class="STYLE6" style="width:22%">Type</td>
            <td class="STYLE6" style="width:23%">Modify</td>
            <td class="STYLE6" style="width:25%">Delete</td>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
          <tr>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
            <td class="cellstyle"/>
          </tr>
        </table></td>
      <td class="tab_15"></td>
    </tr>
    <tr>
      <td height="35" class="tab_18"/>
      <td class="tab_19"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>               
            <td class="STYLE4" >&nbsp;&nbsp;<span id="record"></span>  Items</td>
            <td><table border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="40"><div class="first"></div></td>
                  <td width="45"><div class="back"></div></td>
                  <td width="45"><div class="next"></div></td>
                  <td width="40"><div class="last"></div></td>
                  <td width="100"><div align="center"><span class="STYLE1">Jump to 
                      <input type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;" id='pageIndex'/>
                      Page </span></div></td>
                  <td width="40"><div class="go"></div></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
      <td class="tab_20" />
    </tr>
  </table>
  <input id="index" type="hidden" />
</form>
</body>
</html>
